package cn.wenhaha.lazy;

/**
 * @ClassName: LazyFive
 * @description: TODO  使用枚举特性，来实现线程安全的懒汉模式
 * @author: wyndem
 * @date: 2019/5/13 12:56
 * @Version: 1.0
 **/
public class LazyFive {

    private LazyFive() {
    }

    public  static  LazyFive getInstance(){
        return LazyHolder.INSTANCE.getLazyFive();
    }


    private enum  LazyHolder{
        INSTANCE;
        private LazyFive lazyFive;

        LazyHolder() {
            this.lazyFive = new LazyFive();
        }

        private LazyFive getLazyFive(){
            return lazyFive;
        }
    }


}
